package net.neptech.exception;

import lombok.Getter;
import net.neptech.vm.enums.ResultStatusEnum;

/**
 * 自定义业务异常
 */
@Getter
public class BusinessException extends RuntimeException {
    /**
     * 错误码
     */
    private final int code;

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(ResultStatusEnum errorCode) {
        super(errorCode.getMsg());
        this.code = errorCode.getCode();
    }
}
